<template>
  <div id="detail">
    <el-table
            :data="question"
            style="width: 100%"
            border
            id="table">
          <el-table-column
                  label="问题">
            <template slot-scope="scope">
              <div v-if="!isNull(record[scope.row.key])">{{scope.row.value}}</div>
            </template>
          </el-table-column>
          <el-table-column
                  label="答案">
            <template slot-scope="scope">
              <div v-if="!isNull(record[scope.row.key])">{{record[scope.row.key]}}</div>
            </template>
          </el-table-column>
<!--        </div>-->

    </el-table>
  </div>
</template>

<script>
  import {question} from "./question";

  export default {
    name: "RecordDetail",
    data(){
      return{
        record : {},
        question:[]
      }
    },
    mounted() {
      this.record = this.$route.params.record
      this.question = question
      console.log(this.$route.params.record)
    },
    methods:{
      isNull(item){
        return !item && typeof(item)!="undefined" && item!=0
      }
    }
  }
</script>

<style scoped>

</style>